Sessions



To activate a session, simply use the get_session command and store the result:

If the browser already has a cookie that matches an active session, then the data for that session is made available through the given variable (in this case someVar) as an associative array. If the browser doesn't have a cookie, or that cookie doesn't match an active session, a new session array is created and the browser is sent a "Set-Cookie" field as part of the response.
There are some special members of the session array:

If you wish to remove session data from memory, use:
Keep in mind that if you have already used the <:get_session> command, the variable you assigned the session data to is still good. However, if you overwrite that variable with something else, then the session data will be removed from memory. Otherwise, the session data won't be deleted until the connection ends. <:set form <:read_form>> <:ifempty form["Logout"]> <:set sdata <:get_session>> <:require form["new name"] form["new value"]> <:set sdata[form["new name"]] form["new value"]> <:/require> <:else> <:end_session> <:/ifempty>

Current Session Variables

<:foreach name value sdata> <:/foreach>
<:echo name> <:echo value>

Add Another Variable

Name:
Value:


back to Contents/back to Quick Start